package model;

import java.text.SimpleDateFormat;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-12-06
 * Time: 17:02
 */
public class MicroBlog {
    public static int cnt = 0;

    private String title;
    private String content;
    private int userId;
    private String username;
    private int blogId;
//    private String postTime;

    public int getBlogId() {
        return blogId;
    }

    public void setBlogId() {
        this.blogId = cnt++;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

//    //把这个方法里面的时间戳构造成格式化时间, 以String的方式来进行返回
//    public String getPostTime() {
//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yy-MM-dd HH:mm:ss");
//        return simpleDateFormat.format(this.postTime);
//    }
//
//    public void setPostTime(String postTime) {
//        this.postTime = postTime;
//    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
}
